import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/ycCategory',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/ycCategory/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/ycCategory',
    method: 'put',
    data
  })
}

export function getUpIdIsNotNullList(data) {
  return request({
    url: 'api/ycCategory/getUpIdIsNotNullList',
    method: 'get',
    data
  })
}

export function getUpIdIsNull(data) {
  return request({
    url: 'api/ycCategory/category',
    method: 'get'
  })
}

export function getTree(data) {
  return request({
    url: 'api/ycCategory/tree',
    method: 'get'
  })
}

export default { add, edit, del, getUpIdIsNotNullList, getUpIdIsNull, getTree }
